package org.example.util;

import org.example.domain.User;
import org.springframework.stereotype.Component;

@Component
public class UserThreadLocalUtil {
    private static final ThreadLocal<User> threadLocal = new ThreadLocal<>();
    public User get(){
        return threadLocal.get();
    }
    public void set(User user){
        threadLocal.set(user);
    }
    public void remove(){
        threadLocal.remove();
    }
}
